try {
const nutrDefRes = await nutrDefApi.getNutrDef();
this.setState({ nutrDef: nutrDefRes.data });
resolve();
} catch (err) {
reject();
return;
}
resolve();
})
render() {
if (this.props.error) {
return (<ErrorPage message={this.props.errorMessage} />);
}
return (
<div
style={{
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
}}
>
<Notifications ref={this.notificationsRef} />
<div className={this.props.classes.table}>
<MaterialTable
options={{
pageSize: 10,
pageSizeOptions: [10, 50, 200],
exportButton: true,
addRowPosition: 'first',
emptyRowsWhenPaging: false,
}}
columns={[
{ title: 'Tag Name', field: 'tagname' },
{ title: 'Description', field: 'nutrDesc' },
{ title: 'Units', field: 'units' },